//此处放注册界面API接口，编写者：@3188066816
import axios from 'axios';

const apiClient = axios.create({
    //测试用后端路径，记得改
    baseURL: 'http://localhost:8000/score/',
    headers: {
        'Content-Type': 'application/json',
    },
});

export default {
    //从后端获取全部学生信息的方法
    getAll(){
        return apiClient.get('get_all/')
    },
    //删除指定学生的方法
    del_one(student_id,del_course_name){
        return apiClient.post('del_one/',{
            type:"del",
            del_student_id:student_id,
            del_course_name,
        })
    },
    //加一条
    add_one(formData){
        return apiClient.post('add_one/',formData)
    },
    updata_one(formData,old_course_name){
        return apiClient.post('updata_one/',{
            formData,
            old_course_name
        })
    },
    getCoursesForm(){
        return apiClient.get('get_course_form/');
    },
    getStudents(){
        return apiClient.get('getStudents/');
    }
};
